package com.amigo.online.provider.user.rocketmq.consumer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.amigo.online.provider.user.rocketmq.PushMessage;
import com.amigo.online.provider.user.rocketmq.model.BaseMqSendModel;
import com.amigo.online.provider.user.service.UserService;

@Component("CompressionAvatar")
public class CompressionAvatarConsumer implements PushMessage {

    @Autowired
    private UserService userService;

    @Override
    public void handleMessage(BaseMqSendModel baseMqSendModel) {

        Long id = ((Integer) baseMqSendModel.getSendContentBean()).longValue();
        if (id != null && id > 0) {
            userService.CompressionAvatar(id);
        }
    }


}
